package top.xqf.homework.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.xqf.homework.base.BaseResult;
import top.xqf.homework.entity.TbYsArms;
import top.xqf.homework.entity.TbYsAtr;
import top.xqf.homework.service.ArmsService;
import top.xqf.homework.service.AtrService;

import java.util.List;

@RestController
@RequestMapping("/atr")
public class AtrController {
    @Autowired
    private AtrService atrService;

    @GetMapping("/query")
    public BaseResult<List<TbYsAtr>> query(TbYsAtr tbYsAtr) throws Exception {
        return atrService.query(tbYsAtr);
    }

    @PostMapping("/add")
    public BaseResult<TbYsAtr> add(TbYsAtr tbYsAtr) throws Exception{
        return atrService.add(tbYsAtr);
    }

    @PostMapping("/update")
    public BaseResult<TbYsAtr> update(TbYsAtr tbYsAtr) throws Exception{
        return atrService.update(tbYsAtr);
    }

    @PostMapping("/delete")
    public BaseResult<TbYsAtr> delete(TbYsAtr tbYsAtr) throws Exception{
        return atrService.delete(tbYsAtr);
    }
}
